package scau.zzf.web;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import scau.zzf.base.beanvalidator.ValidId;
import scau.zzf.base.beanvalidator.ValidObject;
import scau.zzf.base.common.BaseController;
import scau.zzf.base.common.Result;
import scau.zzf.base.common.Unique;
import scau.zzf.entity.User;
import scau.zzf.service.IUserService;

import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zzf on 2017/3/30.
 */
@Api(description = "平台用户管理 ** 修改增加厂家用户**",tags = "管理厂家（企业）模块")
@RestController
@RequestMapping("/platform/user")
public class UserController extends BaseController {
    @Autowired
    private IUserService iUsersService;


    /**
     * @author zzf
     * @param loginName
     * @param users
     * @param result
     * @return
     */

    @ApiOperation("/增加厂家管理员")
    @ApiImplicitParams({
            @ApiImplicitParam(name = User.USERNAME,value = "用户名",paramType = "query"),
            @ApiImplicitParam(name =  User.PASSWORD,value = "密码",paramType = "query"),
            @ApiImplicitParam(name =  User.FREE_TIME,value = "试用期",paramType = "query"),
            @ApiImplicitParam(name =  User.USER_TYPE,value = "0 超级管理员 1普通管理员",paramType = "query"),
    })
    @PostMapping("/add")
    public Result vaAddUser(@ModelAttribute("loginName")String loginName ,
                         @Validated({ValidObject.class}) User users,
                         BindingResult result) {
        return Result.ok();
    }


    /**
     * @author zzf
     * @param users
     * @param result
     * @return
     */
    @ApiOperation("/修改用厂家用户信息")
    @PostMapping("/update")
    public Result vaUpdateUser(@Validated({ValidId.class, ValidObject.class}) User users,
                               BindingResult result) {
        return Result.ok();
    }





}
